<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Statistic extends MY_Controller {
    
    public function __construct()
    {
        parent::__construct(); 
        $this->load->model('statistic_mod');
    }
    
	/**
     *   
     *    
     */
    public function index( )
    {        
        $data['menu_page'] = "statistic"; // Koja je stranica. current menu item
        $data['statistic']=NULL;
        // Definisi koji se view ucitava
        $data['contents'] = 'statistic/statistic_home';
        
        $this->load->view('main',$data);
    }
     public function filter_submit() {
        try {
            $filter = $this->input->post('filter');
            $data['statistic'] = $this->statistic_mod->getStatistic($filter);
            
            
            $html = $this->load->view('statistic/statistic_list', $data, true);
            $response = array(
                'ind' => 1,
                'msg' => "",
                'num_users' => 0,
                'html' => $html
            );
        } catch (Exception $e) {

            $response = array(
                'ind' => 0,
                'msg' => 'Following errors occured: <br />' . $e->getMessage(),
                'num_users' => 0,
                'html' => ''
            );
        }
        echo json_encode($response);
    }
   
}
/* End of file statistic.php */
/* Location: ./application/controllers/statistic.php */